﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Jim.K3Cloud;

/// <summary>
/// 提交
/// </summary>
[Sdk("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Submit", "提交")]
public class K3CloudSubmitRequest : ISdkRequest<K3CloudSubmitResponse> ,IK3CloudCustomRequest
{
    public string FormId { get; set; }
    /// <summary>
    /// 创建者组织内码（非必录）
    /// </summary>
    public int CreateOrgId { get; set; }
    /// <summary>
    /// 单据编码集合，数组类型，格式：[No1,No2,...]（使用编码时必录）
    /// </summary>
    public string[] Numbers { get; set; }
    /// <summary>
    /// 单据内码集合，字符串类型，格式："Id1,Id2,..."（使用内码时必录）
    /// </summary>
    public string Ids { get; set; }
    /// <summary>
    /// 工作流发起员工岗位内码，整型（非必录） 注（员工身兼多岗时不传参默认取第一个岗位）
    /// </summary>
    public int SelectedPostId { get; set; }
    /// <summary>
    /// 是否启用网控，布尔类型，默认false（非必录）
    /// </summary>
    public bool NetworkCtrl { get; set; } = false;
    /// <summary>
    /// 否允许忽略交互，布尔类型，默认true（非必录）
    /// </summary>
    public bool IgnoreInterationFlag { get; set; } = true;

    public object QueryParams()
    {
        return new
        {
            FormId = FormId,
            Data = new {
                CreateOrgId = CreateOrgId,
                Numbers = Numbers,
                Ids = Ids,
                SelectedPostId = SelectedPostId,
                NetworkCtrl = NetworkCtrl,
                IgnoreInterationFlag = IgnoreInterationFlag,
            }
        };
    }

    public void Validate()
    {
    }
}



public class K3CloudSubmitResponse : SdkResponse<List<ResponseStatusEntity>>
{
}